package com.dhcc.bpm.modules.scf.controller.HomePageController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.scf.dto.HomePageDTO.ScfMiddleInfoDTO;
import com.dhcc.bpm.modules.scf.service.HomePageService.IScfMiddleInfoService;
import com.dhcc.bpm.modules.scf.vo.HomePageVO.ScfMiddleInfoVO;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 中间列表控制器
 */
@RestController
@AllArgsConstructor
public class ScfMiddleInfoController extends BladeController {
    private IScfMiddleInfoService scfMiddleInfoService;

    @GetMapping("/scfGetMiddleInfo")
    // @Cacheable(value = "middleInfoCache", key = "'MiddleInfo'")
    public R<IPage<ScfMiddleInfoVO>> selectMiddleInfo(Query query, ScfMiddleInfoDTO scfMiddleInfo) {
        IPage<ScfMiddleInfoVO> scfMiddleInfoVOIPage = scfMiddleInfoService.selectMiddleInfo(Condition.getPage(query), scfMiddleInfo);
        return R.data(scfMiddleInfoVOIPage);
    }
}
